package com.brayan.webapp.model;

import java.io.Serializable;
import java.util.Calendar;

import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;

public abstract class RootEntity implements Serializable {
	
	@SuppressWarnings("unused")
	private Calendar dateCreated;
	@SuppressWarnings("unused")
	private Calendar dateModified;
	
	/***** EVENT HOOKS *****/
	@PrePersist
	protected void onCreate() {
		dateCreated = Calendar.getInstance();
	}

	@PreUpdate
	protected void onUpdate() {
		dateModified = Calendar.getInstance();
	}

}
